libxc: fix segfault on uninitialized xch->fmem
authorSeraphime Kirkovski <kirkseraph@gmail.com>
Tue, 4 Apr 2017 12:40:48 +0000 (14:40 +0200)
committerWei Liu <wei.liu2@citrix.com>
Tue, 4 Apr 2017 13:51:23 +0000 (14:51 +0100)
commitc4bdbec00c9063736361124a3492ebceabfaed06
treefe009e2f121d834f37120a55bb98921bd92957bf
parent938fd2586eb081bcbd694f4c1f09ae6a263b0d90
libxc: fix segfault on uninitialized xch->fmem

Currently in xc_interface_open, xch->fmem is not initialized
and in some rare case the code fails before ever assigning a value
to it.

I got this in master:

   $ sudo ./xl/xl run
   xencall: error: Could not obtain handle on privileged command interface: No such file or directory
   Segmentation fault

This initializes the whole xch_buff to 0.

Signed-off-by: Seraphime Kirkovski <kirkseraph@gmail.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
tools/libxc/xc_private.c